package com.xmtlxx.system.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.domain.entity.SysProcess;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.system.domain.bo.SysProcessBo;
import com.xmtlxx.system.domain.vo.SysProcessVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 业务流程Mapper接口
 *
 * @author xmtlxx
 * @date 2022-04-24
 */
public interface SysProcessMapper extends BaseMapperPlus<SysProcessMapper, SysProcess, SysProcessVo> {
    /**
     * 根据条件分页查询业务流程
     *
     * @param sysProcess 业务流程
     * @return Page SysProcess
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "s.dept_id"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    Page<SysProcessVo> selectPageSysProcessList(@Param("page") Page<SysProcess> page,@Param("sysProcess") SysProcessBo sysProcess);

    /**
     * 查询业务流程列表
     *
     * @param sysProcess 业务流程
     * @return 业务流程集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "s.dept_id"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    List<SysProcessVo> selectSysProcessList(@Param("sysProcess") SysProcessBo sysProcess);

    /**
     * 待办事项
     * @param sysProcess
     * @return
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "s.dept_id"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    List<SysProcessVo> selectUndealBuss(@Param("sysProcess") SysProcessBo sysProcess);

}
